package cn.zyy.controller;

import cn.zyy.entity.Score;
import cn.zyy.service.ScoreService;
import cn.zyy.service.ScoreServiceImpl;

import java.util.List;

/**
 * 成绩控制层
 */
public class ScoreController {
    private ScoreService scoreService = new ScoreServiceImpl();
    //根据学生姓名、科目名称和分数给学生记录成绩
    public Boolean addScore(String stuName, String courseName, Double score) {
        return scoreService.addScore(stuName, courseName, score);
    }

    //根据科目名称查询所有学生的成绩，并降序排列
    public List<Score> findScoreByCourseName(String courseName) {
        return scoreService.findAllScore(courseName);
    }

}
